package test.core;

import static test.core.SeleneseTestCaseEx.*;

public class Check {
	public Boolean checkTextOnPage(String warnText) {
		Boolean result = true;
		System.out.println("There should be displayed '" + warnText + "' text on page.");
		try {
			if (!browser.isTextPresent(warnText)) {
				System.out.println("The text was not found on page");
				result = false;
			}
			
		} catch (Exception e) {
			System.out.println(e.getMessage());
			result = false;
		} finally {
			if(result){
				org.testng.Reporter.log("Success");
			} else {
				org.testng.Reporter.log("The text was not found on page");
			}
			
		}
		return result;
	}
}
